// @ts-nocheck
<template>
    <div id="app">
        <router-view class="router-view"></router-view>
    </div>
</template>

<script>
export default {
    name: "app",
    watch: {
        $route: 'pathChange'
    },
    methods: {
        pathChange() {
            if(this.$route.meta && this.$route.meta.title){
                document.title = this.$route.meta.title;
                try {
                    //设置丰声导航栏title  
                    //ExpressPlugin.setNavigationBarTitle(() => {}, () => {}, this.$route.meta.title) // eslint-disable-line
                } catch(e) {
                    //设置失败
                }
            }
            // if(this.$route.meta && this.$route.meta.mateInfo){
            //     let con="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=4.0, user-scalable=yes";
            //     document.querySelector('meta[name="viewport"]').setAttribute("content",con);
            // }else{
            //     let con="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no";
            //     document.querySelector('meta[name="viewport"]').setAttribute("content",con);
            // }

        }
    },
    created(){
    	let href=decodeURI(window.location.href);
        let dataHref=href.split('?');
        if(dataHref.length>1){
			let urlData=dataHref[1].split('&');
			urlData.map(it=>{
				let itName=it.split('=');
				if(itName[0]=='token'){
					localStorage.token=itName[1];
				}

				if(itName[0]=='userId'){
					localStorage.userid=itName[1];
				}

				if(itName[0]=='userName'){
					localStorage.username=itName[1];
				}

				if(itName[0]=='env'){
					localStorage.env=itName[1];
				}



			});
        }

		if (!!window.native && !!window.native.sendMessage && typeof (window.native.sendMessage) == 'function') {
			var json = {
				"action": "isShowBar",
				"callback": "",
				"data": {
					"isShowBar": false,
				}
			};
			window.native.sendMessage(JSON.stringify(json))
		}


    },
    mounted() {
		//
		// localStorage.token='A3_fd53a8b6a7caea3c99ebe655010797391629357571690';
		// localStorage.userid='856454';

    }


};
</script>

<style lang="less">
    #app{
        width: 100%;
        height: 100%;
    }
    .router-view{
        position:absolute;
        top:0;
        left:0;
        right:0;
        bottom:0;
        height: 100%;
        overflow: auto;
        font-size: 14px;
        box-sizing: border-box;
    }
</style>
